package com.hjt.gulimall.product.vo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.hjt.gulimall.product.entity.SkuImagesEntity;
import com.hjt.gulimall.product.entity.SkuInfoEntity;
import com.hjt.gulimall.product.entity.SpuInfoDescEntity;
import lombok.Data;

import java.util.List;

/**
 * 商品详细信息
 * @author:97007
 * @date:2021/9/27 17:02
 */
@Data
public class SkuItemVo {
    private SkuInfoEntity info; // 基本信息
    private boolean hasStock = true; // 是否有货
    private List<SkuImagesEntity> images; // 图片信息
    private SpuInfoDescEntity description; // 商品介绍
    private List<SkuItemSaleAttrVo> saleAttrVos; // 销售属性
    private List<SpuItemBaseGroupVo> attrGroupVos; // 基本属性分组

    // 销售属性vo
    @Data
    public static class SkuItemSaleAttrVo{
        private Long attrId;
        private String attrName;
        private List<AttrValueWithSkuIdVo> attrValues;
    }

    // 基本属性分组
    @Data
    public static class SpuItemBaseGroupVo {
        private String groupName;
        private List<SkuBaseAttrVo> attrVos;
    }

    // 基本属性
    @Data
    public static class SkuBaseAttrVo {
        private Long attrId;
        private String attrName;
        private String attrValue;
    }

    // 属性的值以及拥有该值的skuId列表串
    @Data
    private static class AttrValueWithSkuIdVo {
        private String attrValue;
        private String skuIds;
    }
}
